package cc.rengu.igas.route.common.enums;

/**
 * 签约状态枚举
 *
 * @author lizhangtao
 * @version 1.0
 * @date 20200708
 */
public enum SignedStatusEnum {
    /**
     * 客户未在通道签约
     */
    UNSIGNED("0", "未签约"),
    /**
     * 客户未已经在通道签约
     */
    SIGNED("1", "已签约"),
    ;

    private String code;
    private String name;

    SignedStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static SignedStatusEnum create(String code) {
        SignedStatusEnum type = null;
        if (code == null) {
            return null;
        }
        switch (code) {
            case "0":
                type = UNSIGNED;
                break;
            case "1":
                type = SIGNED;
                break;
            default:
                break;
        }
        return type;
    }

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return name;
    }
}
